<div id="content">
    <div id="page-heading"><h1>Quản lý hóa đơn đã xử lý</h1></div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized"><img src="<?= base_url(); ?>images/admin_img/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
            <th class="topleft"></th>
            <td id="tbl-border-top">&nbsp;</td>
            <th class="topright"></th>
            <th rowspan="3" class="sized"><img src="<?= base_url(); ?>images/admin_img/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
        </tr>
        <tr>
            <td id="tbl-border-left"></td>
            <td>
                <!--  start content-table-inner -->
                <div id="content-table-inner">
                    <div class="table-content">
                        <div class="search">
                            <form namr="fr-search" id="fr-search" method="post" action="<?= base_url(); ?>dienhoa-administrator/hoa_don/hoa_don_all">
                                <ul class="ul-search">
                                    <li>Mã hóa đơn: </li>
                                    <li><input type="text" name="txtMHD" id="txtMHD" value=""/></li>
                                    <li>Tên khách hàng: </li>
                                    <li><input type="text" name="txtKH" id="txtKH" value=""/></li>
                                    <li>Ngày đặt hàng: </li>
                                    <li><input type="text" name="txtODate" id="from" value=""/></li>
                                    <li>Ngày nhận hàng: </li>
                                    <li><input type="text" name="txtOSDate" id="to" value=""/></li>
                                    <li><input type="submit" name="btnSend" value="Tìm"/></li>
                                </ul>
                            </form>
                            <div class="clear"></div>
                        </div>
                        <div class="tb_TCHoaDon">
                            <form name="formHD" id="formHD" action="<?= base_url();?>dienhoa-administrator/hoa_don/xoa" method="post">
                                <table class="table_infor">
                                    <thead>
                                        <tr>
                                            <th><input type="checkbox" name="items" id="items"/></th>
                                            <th>ID</th>
                                            <th>Ngày lập</th>
                                            <th>Ngày giao hàng</th>
                                            <th>Tên khách hàng</th>
                                            <th>Tổng tiền</th>
                                            <th>Trạng thái</th>
                                            <th>Chi tiết</th>
                                        </tr>
                                    </thead>
                                    <tbody id="bd-hd">
                                        <? foreach ($hoa_don as $rows): ?>
                                            <tr>
                                                <td><input type="checkbox" name="item[]" id="items" value="<?= $rows->OID; ?>"/></td>
                                                <td class="Ma"><?= $rows->OID; ?></td>
                                                <td class="Ngay"><?= date_format(date_create($rows->ODate), "d-m-Y") ?></td>
                                                <td class="Ngay"><?= date_format(date_create($rows->OSDate), "d-m-Y"); ?></td>
                                                <td><?= $rows->OName; ?></td>
                                                <td><?= format_price($rows->Amount, "VND"); ?></td>
                                                <? $opt = $rows->OStatus ?>
                                                <td>
                                                    <?
                                                    switch ($opt) {
                                                        case 1: echo "Chưa xử lý";
                                                            break;
                                                        case 2: echo "Đang xử lý";
                                                            break;
                                                        case 3: echo "Đã xử lý";
                                                            break;
                                                        default : echo "";
                                                    }
                                                    ?>
                                                </td>
                                                <td><a href="<?= base_url();?>dienhoa-administrator/hoa_don/chi_tiet_hoa_don/<?= $rows->OID;?>">Xem</a></td>
                                            </tr>
                                        <? endforeach; ?>
                                    </tbody>
                                    <tfoot>
                                        <tr>
                                            <td><input type="submit" value="xóa" class="btnXoa"/></td>
                                            <td colspan="6" style="width: 50px;"><div class="phan_trang"><?= $pagination; ?></div></td>
                                        </tr>
                                    </tfoot>
                                </table>
                            </form>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
                <!--  end content-table-inner  -->
            </td>
            <td id="tbl-border-right"></td>
        </tr>
        <tr>
            <th class="sized bottomleft"></th>
            <td id="tbl-border-bottom">&nbsp;</td>
            <th class="sized bottomright"></th>
        </tr>
    </table>

    <div class="clear">&nbsp;</div>

</div>
